1. Field of the Invention
This invention pertains generally to controlling picture quality and bit rate of compressed video, and more particularly to bit rate control during encoding.
2. Description of Related Art
Current state of the art digital video compression standards, such as MPEG-1, MPEG-2, MPEG-4, and AVC (H.264) describe several picture types, for example I, P, and B picture types. In general, for similar picture content to be encoded with similar picture quality, an I picture takes more bits to encode than a P picture, and a P picture takes more bits to encode than a B picture. As defined in recent standards such as MPEG-1/2/4 and/or AVC, the picture quality and the number of bits for each encoded picture are controlled by adjusting the quantization parameters of a picture.
The conventional forms of rate control are configured for controlling bit rate directly in response to changing the quantization scale. Varying the coarseness of the quantization step in this manner directly affects the size of the output. However, this form of simple rate control is not optimal because requiring the use of coarse quantization reduces image quality.
It is preferable to allocate proportionally more bits to encode I- and P-frames. The quality of frames used as references should be the highest, because any errors will propagate from reference frames to other frames within a GOP. Fewer bits are then allocated to B-frames because they do not act as reference frames and thus cannot spread errors to other frames. Furthermore, B-frames benefit from more extensive motion-compensation tactics and are therefore naturally the smallest frames. A typical ratio of frame sizes is 12:4:1 for I:P:B frames.
As the frame is encoded by the classical forms of rate control, rate control information is updated at the end of each row of macroblocks to keep track of how well the actual number of bits used matches the predicted output. The quantization scale is updated and the new value is applied to the next row if adherence to the predictive model is outside certain boundaries. After an entire picture is coded, the parameters for the prediction model are updated so as to match the number of bits that were actually produced. In this form of rate control, the picture quality was not a part of the key considerations.
Therefore, a need exists for a picture level rate control method that sufficiently controls buffer fullness without unduly compromising picture quality. The present invention satisfies those needs, as well as others, and overcomes the deficiencies of previously developed bit rate control mechanisms.